/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface CoreClsgjl extends BasicModel<CoreClsgjl> {
  clsgjlCph?: string; // 车牌号
  clsgjlPpxh?: string; // 品牌型号
  clsgjlClsbdm?: string; // 车辆识别代码
  clsgjlFdjhm?: string; // 发动机号码
  clsgjlSgfsrq?: string; // 事故发生日期
  clsgjlJsy?: string; // 驾驶员
  clsgjlSgfsdd?: string; // 事故发生地点
  clsgjlSgxz?: string; // 事故性质
  clsgjlSgzrf?: string; // 事故责任方
  clsgjlCsqk?: string; // 车损情况
  clsgjlCjrName?: string; // 创建人
  updateByName?: string; // 修改人
}

export const coreClsgjlList = (params?: CoreClsgjl | any) =>
  defHttp.get<CoreClsgjl>({ url: adminPath + '/cardd/sgjl/coreClsgjl/list', params });

export const coreClsgjlListData = (params?: CoreClsgjl | any) =>
  defHttp.post<Page<CoreClsgjl>>({ url: adminPath + '/cardd/sgjl/coreClsgjl/listData', params });

export const coreClsgjlForm = (params?: CoreClsgjl | any) =>
  defHttp.get<CoreClsgjl>({ url: adminPath + '/cardd/sgjl/coreClsgjl/form', params });

export const coreClsgjlSave = (params?: any, data?: CoreClsgjl | any) =>
  defHttp.postJson<CoreClsgjl>({ url: adminPath + '/cardd/sgjl/coreClsgjl/save', params, data });

export const coreClsgjlImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/cardd/sgjl/coreClsgjl/importData',
      onUploadProgress,
    },
    params,
  );

export const coreClsgjlDelete = (params?: CoreClsgjl | any) =>
  defHttp.get<CoreClsgjl>({ url: adminPath + '/cardd/sgjl/coreClsgjl/delete', params });
